import request from '@/utils/request'

export default {

    // 根据课程id查询章节和小节信息
    queryChapterAndVideoByCourseId(courseId) {
        return request({
            url: `/eduservice/chapter/queryChapterAndVideoByCourseId/${courseId}`,
            method: 'get'
        })
    },

    // 新增章节
    insertChapter(chapter) {
        return request({
            url: `/eduservice/chapter/insertChapter`,
            method: 'post',
            data: chapter
        })
    },

    // 根据id查询章节
    queryChapterById(id) {
        return request({
            url: `/eduservice/chapter/queryChapterById/${id}`,
            method: 'get'
        })
    },

    // 根据章节对象更新数据
    updateChapter(chapter) {
        return request({
            url: `/eduservice/chapter/updateChapter`,
            method: 'put',
            data: chapter
        })
    },

    // 根据id删除章节
    deleteChapterById(id) {
        return request({
            url: `/eduservice/chapter/deleteChapterById/${id}`,
            method: 'delete'
        })
    },
}